    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>

	<script src="./js/jquery-1.7.1.min.js"></script>
	<script src="./js/jquery-ui-1.8.18.custom.min.js"></script>
	<script type="text/javascript" src="http://localhost/svg/js/jquery.svg.js"></script> 
</head>
<body>

<script type="text/javascript">

$(document).ready(function() 
    {
    $("#svgload").svg({
        onLoad: function()
            {
            var svg = $("#svgload").svg('get');
            svg.load('lion.svg', {addTo: true,  changeSize: true});        
            },
        settings: {}}
        );
    $("#svgload1").svg({
        onLoad: function()
            {
            var svg = $("#svgload1").svg('get');
            svg.load('svg/antenna.svg', {addTo: true,  changeSize: true});        
            },
        settings: {}}
        );


    $('#btnTest').click(function(e)
        {
    	var svg = $("#svgload").svg('get');
    	var g = $('g', svg.root())[0];
    	svg._svg.width.baseVal.convertToSpecifiedUnits(5);
    	svg._svg.height.baseVal.convertToSpecifiedUnits(5);
    	var widthPX = svg._svg.width.baseVal.valueInSpecifiedUnits;
    	var heightPX = svg._svg.height.baseVal.valueInSpecifiedUnits;
    	var scalew = 50 / widthPX;
    	var scaleh = 50 / heightPX;
    	var scale = 0;
    	if (scalew < scaleh) {
    		scale = scalew;
    	} else {
    		scale = scaleh;
    	}
    	g.setAttribute('transform', 'scale('+scale+')');
    	
    	var svg = $("#svgload1").svg('get');
    	var g = $('g', svg.root())[0];
    	svg._svg.width.baseVal.convertToSpecifiedUnits(5);
    	svg._svg.height.baseVal.convertToSpecifiedUnits(5);
    	var widthPX = svg._svg.width.baseVal.valueInSpecifiedUnits;
    	var heightPX = svg._svg.height.baseVal.valueInSpecifiedUnits;
    	var scalew = 50 / widthPX;
    	var scaleh = 50 / heightPX;
    	var scale = 0;
    	if (scalew < scaleh) {
    		scale = scalew;
    	} else {
    		scale = scaleh;
    	}
    	g.setAttribute('transform', 'scale('+scale+')');
     });    

    });
    
    function toPixels(unit, value) {
    	if (unit == 6) {
    		return value * 96 / 72;
    	} else {
    		return value;
    	}
    }
</Script>   

<div id="svgload" style="width: 50px; height: 50px; border: 1px Solid Black;"></div>
<div id="svgload1" style="width: 50px; height: 50px; border: 1px Solid Black;"></div>

<div id="btnTest">
Click Me!
</div>

</body>
</html>